<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./css预编译/bb/keydown.css" />
  </head>
  <body>
    <div id="app">
      <!-- 传$event -->
      <a href="http://chst.vip" @click.prevent="handleop('你会成功的孩子')"
        >go</a
      >
      <input
        type="text"
        placeholder="氢融合"
        @keydown.enter="go()"
        v-model="val"
      />

      <div class="father" @click="handone">
        <div class="child" @click.stop="handtwo"></div>
      </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
    <script>
      //按键修饰符
      //keydown
      const vm = new Vue({
        el: "#app",
        data: {
          val: "",
        },
        methods: {
          handleop(t) {
            console.log(t);
          },
          go() {
            console.log(this.val);
          },
          handone(){
               console.log("我是父子")
          },
          handtwo(){
            console.log("我是儿子")
          }
        },
      });
    </script>
  </body>
</html>
